# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=jaadas
pkgver=0.1
pkgrel=1
pkgdesc='Joint Advanced Defect assEsment for android applications.'
groups=('blackarch' 'blackarch-scanner')
arch=('any')
url='https://github.com/flankerhqd/JAADAS/'
license=('GPL3')
depends=('java-environment')
makedepends=('git')
source=("https://github.com/flankerhqd/JAADAS/releases/download/release$pkgver/$pkgname-$pkgver.zip")
sha512sums=('727f5d4923bd9135c2973e887e530650bf7c6bac1d1d38416295466df596ec29c77e5f3ff82bedc188cf1ed969fba0be8f7085e7cd9d1b7c2f26c42bef469593')

package() {
  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  rm "$pkgname-$pkgver.zip"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec java -jar jade-$pkgver.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

